﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Yule8xCommon.Applib;
using Yule8xCommon.Db;

namespace Yule8xWechat.PublicServices
{
    public partial class UserService : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string action = RequestUtil.GetString("action");
            switch (action)
            {
                case "check_game_id":
                    int gameid = RequestUtil.GetInteger("gameid");
                    Response.Write(this.GetUserName(gameid));
                    break;
            }
        }
        private string GetUserName(int gameid)
        {
            if (gameid < 1)
            {
                return string.Empty;
            }
            string sqlstmt = string.Format("select nickname from t_user where game_id={0}",gameid);
            object value=DbFactory.Init(AppInfo.conn_yule8x_agent).GetValue(sqlstmt);
            return (null == value) ? string.Empty : value.ToString();
        }
    }
}